This sample illustrates how to save images using the "Save As" dialog. 

n order to keep things simple, this sample allows only raster images to be loaded and images can be saved in only bmp, jpeg, or gif file formats.

When the "Save" button on the form is clicked, the "Save As" dialog is displayed. In the dropdown menu at the bottom of the "Save As" dialog, there is a choice of file formats in which the image can be saved. In this sample program, only BMP, JPG, and GIF format are allowed. This is done by setting the FileExtension property to the following value:

imageKit1.File.FileExtension = "Bitmap files | *.bmp; |Jpeg files | *.jpg; |Gif files | *.gif";

After the file format has been chosen and the "Save" button clicked in the "Save As" dialog, the File.FileName property value is used and the last three characters are retrieved. A Select-Case block is used to execute the appropriate code needed to save the image in the proper format.

NOTE: When images are saved as JPEG, the image must be 24 bit color or 8 bit grayscale and the JpegQuality value must be set. When images are saved as GIF, the image must be 8 bit or less.